package com.dzt.cloudreader.network;

import com.dzt.cloudreader.model.BookBean;
import com.dzt.cloudreader.model.BookDetailBean;
import com.dzt.cloudreader.model.FrontpageBean;
import com.dzt.cloudreader.model.GankIoDataBean;
import com.dzt.cloudreader.model.GankIoDayBean;
import com.dzt.cloudreader.model.HotMovieBean;
import com.dzt.cloudreader.model.MovieDetailBean;

import rx.Observable;

/**
 * Created by M02323 on 2017/12/6.
 */

public class DataManager {

    private static DataManager instance;

    private DataManager() {
    }

    public static DataManager getInstance() {
        if (instance == null) {
            instance = new DataManager();
        }
        return instance;
    }

    public Observable<GankIoDayBean> getGankIoDay(String year, String month, String day) {
        return RetrofitService.Builder.getGankIOServer().getGankIoDay(year, month, day);
    }

    public Observable<GankIoDataBean> getGankIoData(String type, int prePage, int page) {
        return RetrofitService.Builder.getGankIOServer().getGankIoData(type, prePage, page);
    }

    public Observable<FrontpageBean> getFrontpage() {
        return RetrofitService.Builder.getTingServer().getFrontpage();
    }

    public Observable<HotMovieBean> getHotMovie() {
        return RetrofitService.Builder.getDouBanService().getHotMovie();
    }

    public Observable<MovieDetailBean> getMovieDetail(String id) {
        return RetrofitService.Builder.getDouBanService().getMovieDetail(id);
    }

    public Observable<HotMovieBean> getMovieTop250(int start, int count) {
        return RetrofitService.Builder.getDouBanService().getMovieTop250(start, count);
    }

    public Observable<BookBean> getBook(String tag, int start, int count) {
        return RetrofitService.Builder.getDouBanService().getBook(tag, start, count);
    }

    public Observable<BookDetailBean> getBookDetail(String id) {
        return RetrofitService.Builder.getDouBanService().getBookDetail(id);
    }
}
